<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            width: 200px;
            height: 200px;
            position: relative;
        }
        
        div::before {
            content: "涛涛";
            position: absolute;
            width: 200px;
            height: 200px;
            background-color: #9b59b6;
            font-size: 2em;
            display: flex;
            justify-content: center;
            align-items: center;
            transition-duration: 2s;
        }
        
        div:hover::before {
            /* 旋转 */
            transform: rotate(360deg);
        }
        
        div::after {
            content: "http:taotaozi.ronghanbing.com";
            position: absolute;
            bottom: -2em;
            transform: translateX(999px);
            transition-duration: 1s;
            /* 过度的时间 */
        }
        
        div.move::after {
            transform: translateX(0px);
        }
    </style>
</head>

<body>
    <main>
        <div></div>
    </main>
    <script>
        document.querySelector('div').addEventListener("transitionend", () => {
            document.querySelector('div').className = 'move'
        })
    </script>
</body>

</html>